package my.multithreadtest;

public class SleepingThread extends SimpleThread {

	/**
	 * @param args
	 */
	public void run(){
		while(true){
			//System.out.println(this);
			VisualDbg.synprint(threadId);
			//VisualDbg.synprint();
			//System.out.print(threadId);
			if(--countDown==0)return;
			try{
				//sleep(1);
				sleep(1);
			}
			catch(InterruptedException e){
				throw new RuntimeException();
			}
		}
	}
	public static void main(String[] args) throws InterruptedException{
		// TODO Auto-generated method stub
		for(int i=0;i<5;i++)
			new SleepingThread();
		
		sleep(1000);
		
		System.out.println();
		//join test
		for(int i=0;i<5;i++)
			new SleepingThread().join();
	}

}
